package org.example.gateway.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import jakarta.annotation.PostConstruct;

@Slf4j
@Configuration
public class JwtConfig {

    @Value("${jwt.secret}")
    private String secret;

    @Value("${jwt.expireTime}")
    private long expireTime;

    @PostConstruct
    public void init() {
        log.info("JWT Configuration loaded - Secret: {}, ExpireTime: {}", 
                secret , expireTime);
        
        if (secret == null || secret.equals("default-secret")) {
            log.warn("JWT secret is using default value. Please check your configuration.");
        }
    }

    public String getSecret() {
        return secret;
    }

    public long getExpireTime() {
        return expireTime;
    }
}
